Method for colour component prediction, encoder, decoder and storage medium

ABSTRACT

A method for colour component prediction, an encoder, a decoder and a storage medium are provided. The method includes that: prediction parameters of a current block are determined, the prediction parameters including a prediction mode parameter and a size parameter of the current block; when the prediction mode parameter indicates that a Matrix-based Intra Prediction (MIP) mode is adopted to determine an intra prediction value of the current block, an MIP weight matrix of the current block, a shift factor of the current block and an MIP input sample matrix of the current block are determined; and the intra prediction value of the current block is determined according to the MIP weight matrix, the shift factor and the MIP input sample matrix.

CROSS-REFERENCE TO RELATED APPLICATION

The present disclosure is a U.S. continuation application ofInternational Application No. PCT/CN2020/090688, filed on May 15, 2020,which claims priority to the following applications.

1) Prior U.S. provisional patent application No. 62/872,488 filed in thename of Junyan Huo, Yanzhuo Ma and Wei Zhang on Jul. 10, 2019, andentitled “Matrix-Based Intra Prediction (MIP) Shift UnificationAccording to Block Size and Mode Index”;

2) Prior U.S. provisional patent application No. 62/872,830 filed in thename of Junyan Huo, Yanzhuo Ma and Wei Zhang on Jul. 11, 2019, andentitled “Methods and Apparatuses for Matrix-Based Intra Prediction(MIP) Shift Unification”; and

3) Prior U.S. provisional patent application No. 62/873,170 filed in thename of Junyan Huo. Yanzhuo Ma and Wei Zhang on Jul. 11, 2019, andentitled “Methods and Apparatuses for Matrix-Based Intra Prediction(MIP) Shift Unification”.

The contents of the International Application No. PCT/CN2020/090688,U.S. provisional patent application No. 62/872,488, U.S. provisionalpatent application No. 62/872,830, and U.S. provisional patentapplication No. 62/873,170 are incorporated herein by reference in theirentirety.

BACKGROUND

With the increased requirements of people on video display quality,novel video application forms such as high-definition andultra-high-definition videos have emerged. H.265/High Efficiency VideoCoding (HEVC) cannot meet a requirement for rapid development of videoapplications any longer. The Joint Video Exploration Team (JVET)proposes a next-generation video coding standard H.266/Versatile VideoCoding (VVC), and a corresponding test model is a VVC Test Model (VTM).

SUMMARY

Embodiments of the disclosure relate to the technical field of videocoding and decoding, and particularly to a method for image componentprediction, a coder, a decoder and a storage medium.

The technical solutions of the embodiments of the application may beimplemented as follows.

According to a first aspect, the embodiments of the application providea method for colour component prediction, which may be applicable for anencoder and include the following operations.

Prediction parameters of a current block are determined, the predictionparameters including a prediction mode parameter and a size parameter ofthe current block.

When the prediction mode parameter indicates that an MIP mode is adoptedto determine an intra prediction value of the current block, an MIPweight matrix of the current block, a shift factor of the current blockand an MIP input sample matrix of the current block are determined.

The intra prediction value of the current block is determined accordingto the MIP weight matrix, the shift factor and the MIP input samplematrix. The MIP weight matrix of the current block may be at leastdetermined according to a block size index value of the current blockand the block size index value of the current block may be determinedaccording to the size parameter of the current block.

According to a second aspect, the embodiments of the application providea method for colour component prediction, which may be applicable for adecoder and include the following operations.

A bitstream is parsed to acquire prediction parameters of a currentblock, the prediction parameters including a prediction mode parameterand a size parameter of the current block.

When the prediction mode parameter indicates that an MIP mode is adoptedto determine an intra prediction value of the current block, an MIPweight matrix of the current block, a shift factor of the current blockand an MIP input sample matrix of the current block are determined.

The intra prediction value of the current block is determined accordingto the MIP weight matrix, the shift factor and the MIP input samplematrix. The MIP weight matrix of the current block may be at leastdetermined according to a block size index value of the current blockand the block size index value of the current block may be determinedaccording to the size parameter of the current block.

According to a third aspect, the embodiments of the application providean encoder, which may include a first determination unit and a firstprediction unit.

The first determination unit may be configured to determine predictionparameters of a current block, the prediction parameters including aprediction mode parameter and a size parameter of the current block.

The first determination unit may further be configured to, when theprediction mode parameter indicates that an MIP mode is adopted todetermine an intra prediction value of the current block, determine anMIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block.

The first prediction unit may be configured to determine the intraprediction value of the current block according to the MIP weightmatrix, the shift factor and the MIP input sample matrix. The MIP weightmatrix of the current block may be at least determined according to ablock size index value of the current block and the block size indexvalue of the current block may be determined according to the sizeparameter of the current block.

According to a fourth aspect, the embodiments of the application providean encoder, which may include a memory and a processor.

The memory may be configured to store computer programs capable ofrunning in the processor.

The processor may be configured to run the computer programs to executethe method as described in the first aspect.

According to a fifth aspect, the embodiments of the application providea decoder, which may include a parsing unit, a second determination unitand a second prediction unit.

The parsing unit may be configured to parse a bitstream to acquireprediction parameters of a current block, the prediction parametersincluding a prediction mode parameter and a size parameter of thecurrent block.

The second determination unit may be configured to, when the predictionmode parameter indicates that an MIP mode is adopted to determine anintra prediction value of the current block, determine an MIP weightmatrix of the current block, a shift factor of the current block and anMIP input sample matrix of the current block.

The second prediction unit may be configured to determine the intraprediction value of the current block according to the MIP weightmatrix, the shift factor and the MIP input sample matrix. The MIP weightmatrix of the current block may be at least determined according to ablock size index value of the current block and the block size indexvalue of the current block may be determined according to the sizeparameter of the current block.

According to a sixth aspect, the embodiments of the application providea decoder, which may include a memory and a processor.

The memory may be configured to store computer programs capable ofrunning in the processor.

The processor may be configured to run the computer programs to executethe method as described in the aspect.

According to a seventh aspect, the embodiments of the applicationprovide a computer storage medium, which may store computer programs.The computer programs may be executed by a first processor to implementthe method as described in the first aspect or may be executed by asecond processor to implement the method as described in the secondaspect.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow block diagram of an MIP process according to relatedtechnical solutions.

FIG. 2A is a composition block diagram of a video encoding systemaccording to embodiments of the application.

FIG. 2B is a composition block diagram of a video decoding systemaccording to embodiments of the application.

FIG. 3 is a flowchart of a method for colour component predictionaccording to embodiments of the application.

FIG. 4 is a structure diagram of generating an infra prediction valueaccording to embodiments of the application.

FIG. 5 is a flowchart of another method for colour component predictionaccording to embodiments of the application.

FIG. 6 is a composition structure diagram of an encoder according toembodiments of the application.

FIG. 7 is a composition structure diagram of another encoder accordingto embodiments of the application.

FIG. 8 is a specific hardware structure diagram of an encoder accordingto embodiments of the application.

FIG. 9 is a composition structure diagram of a decoder according toembodiments of the application.

FIG. 10 is a composition structure diagram of a decoder according toembodiments of the application.

FIG. 11 is a specific hardware structure diagram of a decoder accordingto embodiments of the application.

DETAILED DESCRIPTION

In H.266/VVC, an Matrix-based Intra Prediction (MIP) technology has beenaccepted at present. In the technology, different numbers of MIP modesare added in an intra prediction process for different types of intracurrent blocks. However, in an MIP process, particularly in a matrixmultiplication process, determination for a shift factor is alsocorrelated with a type of a current block and an index number of an MIPmode, which causes the prediction process relatively complex andincreases the calculation complexity.

The embodiments of the application provide a method for colour componentprediction, an encoder, a decoder and a storage medium. On an encoderside, prediction parameters of a current block may be determined, theprediction parameters including a prediction mode parameter and a sizeparameter of the current block; when the prediction mode parameterindicates that an MIP mode is adopted to determine an intra predictionvalue of the current block, an MIP weight matrix of the current block, ashift factor of the current block and an MIP input sample matrix of thecurrent block are determined; and the intra prediction value of thecurrent block is determined according to the MIP weight matrix, theshift factor and the MIP input sample matrix. The MIP weight matrix ofthe current block may be at least determined according to a block sizeindex value of the current block and the block size index value of thecurrent block may be determined according to the size parameter of thecurrent block. On a decoder side, a bitstream is parsed to acquireprediction parameters of a current block, the prediction parametersincluding a prediction mode parameter and a size parameter of thecurrent block; when the prediction mode parameter indicates that an MIPmode is adopted to determine an intra prediction value of the currentblock, an MIP weight matrix of the current block, a shift factor of thecurrent block and an MIP input sample matrix of the current block aredetermined; and the intra prediction value of the current block isdetermined according to the MIP weight matrix, the shift factor and theMIP input sample matrix. The MIP weight matrix of the current block maybe at least determined according to a block size index value of thecurrent block and the block size index value of the current block may bedetermined according to the size parameter of the current block. In sucha manner, on either the decoder side or the encoder side, adetermination manner for the shift factor may be simplified, andmoreover, when the shift factor is determined by use of a Look-Up Table(LUT), a memory occupied by storage of a LUT may be reduced at the sametime of reducing the calculation complexity, so that a purpose ofimproving the coding and decoding efficiency is achieved.

In order to understand the characteristics and technical contents of theembodiments of the application in more detail, implementation of theembodiments of the application will be described in detail below incombination with reference to the accompanying drawings. Theaccompanying drawings are for reference only and are not intended tolimit the embodiments of the disclosure.

In a video signal, a first colour component, a second colour componentand a third colour component are usually adopted to represent CodingBlocks (CBs). The three colour components are a luma component, a bluechroma component and a red chroma component respectively. Specifically,the luma component is usually represented by a sign Y, the blue chromacomponent is usually represented by a sign Cb or U. and the red chromacomponent is usually represented by a sign Cr or V. Therefore, the videosignal may be represented in a YCbCr format, and may also be representedin a YUV format.

In the embodiments of the application, the first colour component may bethe luma component, the second colour component may be the blue chromacomponent, and the third colour component may be the red chromacomponent. However, no specific limits are made in the embodiments ofthe application.

A related technical solution to a present prediction process of an MIPtechnology will be described below.

Input data of MIP mainly includes a position (xTbCmp, yTbCmp) of acurrent block, an MIP mode index value (which may be represented bymodeId or modeIdx) when the MIP is adopted by the present block, aheight (represented by nTbH) of the current block, a width (representedby nTbW) of the current block, a transposition processing indicator(which may be represented by isTransposed) indicating whethertransposition is required and the like.

Output data of MIP mainly includes a prediction block of the currentblock. A prediction value corresponding to a pixel coordinate [x][y] inthe prediction block is predSamples[x][y], where x=0, 1 . . . , nTbW−1,and y=0, 1, . . . , nTbH−1.

Here, as shown in FIG. 1, the MIP process may be divided into fouroperations: core parameter configuration 11, reference pixel acquisition12, input sample construction 13 and intra prediction value generation14. Specifically, for core parameter configuration 11, the current blockmay be divided into three types according to a size of the intra currentblock, and mipSizeId or blocksizeIdx is adopted as a block size indexvalue to record the type of the current block. Moreover, current blockscorresponding to different block size index values have differentnumbers of reference samples and different numbers of matrixmultiplication output samples. For reference pixel acquisition 12, whenthe current block is predicted, upper block and left block of thecurrent block are coded blocks, reference pixels of the MIP technologyare reconstructed values of pixels in an upper row and a left column ofthe current block, and a process of acquiring the reference pixels(represented by refT) adjacent to an upper side of the current block andthe reference pixels (represented by refL) adjacent to a left side ofthe current block is a reference pixel acquisition process. For inputsample construction 13, the operation is used for input of matrixmultiplication, and may mainly include reference sample acquisition 131,reference sample buffer construction 132 and matrix multiplication inputsample deduction 133. A reference sample acquisition process is adown-sampling process. Reference sample buffer construction 132 mayfurther include a buffer filling manner 1321 adopted when transpositionis not required and a buffer filling manner 1322 adopted whentransposition is required. For intra prediction value generation 14, theoperation is executed to acquire an MIP-based prediction value of thecurrent block, and may mainly include matrix multiplication outputsample block 141, matrix multiplication output sample embedding 142,matrix multiplication output sample transposition 143 and MIP-basedfinal prediction value generation 144. Matrix multiplication outputsample block construction 11 may further include weight matrixacquisition 1411, shift factor and offset factor acquisition 1412 andmatrix multiplication operation 1413. MIP-based final prediction valuegeneration 144 may further include generation of a prediction value notrequiring up-sampling 1441 and generation of a prediction valuerequiring up-sampling 1442. Then, after the four operations, an intraprediction value of at least one pixel in the current block may beobtained.

In the MIP process shown in FIG. 1, MIP may be represented by thefollowing equation.

P=M×R  (1)

M is a matrix, R is an input sample vector deduced from a referencesample pixel, and P is a prediction pixel value deduced according to theequation (I). That is, MIP is a coding tool and may be used to deduce anintra prediction signal including matrix multiplication. Each specificmatrix M corresponds to an MIP mode.

However, the coefficients of the matrix are initially trained tofloating point values, but these coefficients are required to be storedand calculated to integral values in a computer processing process. Acommon manner for converting a floating point value to an integral valueis usually to multiply the floating point value and a great enough valueto maintain appropriate accuracy, and this manner is usually calledshift operation. Specifically, a left shift operation aims to deduce anintegral value and may be implemented through the following equation.

VAL=val×(1<<shift)  (2)

Herein, val is a floating matrix value, shift is a shift bit number(which may also be called a shift factor) in the shift operation, VAL isa stored integral value, and “<<” represents a left shift operator.

In such a manner, after an integral matrix is obtained, integral matrixmultiplication may be performed. Finally, a right shift operation isexecuted on P to obtain an MIP-based final prediction value. Acalculation equation for the whole process is as follows:

P=(M*(1<<shift)×R)>>shift  (3)

or,

P=(M*(1<<shift)×R+(1<<(shift−1)))>>shift  (4)

Herein. (1<<(shift−1)) represents a rounding operation, and “>>”represents a right shift operator. However, in the latest MIP version,for different block sizes and different MIP modes, corresponding valuesof shift in the shift operation in the equation (3) or the equation (4)are different. That is, a current shift factor is closely correlatedwith a type of a current block and an index value of an MIP mode, whichmakes the prediction process relatively complex and increases thecalculation complexity.

The embodiments of the application provide a method for colour componentprediction, which is applicable for an encoder or a decoder. Afterprediction parameters of a current block is obtained, when a predictionmode parameter in the prediction parameters indicates that an MIP modeis adopted to determine an intra prediction value of the current block,an MIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block may bedetermined, and then the intra prediction value of the current block isdetermined according to the MIP weight matrix, the shift factor and theMIP input sample matrix. In such a manner, on either the decoder side orthe encoder side, a determination manner for the shift factor may besimplified, and moreover, when the shift factor is determined by use ofa LUT, a memory occupied by storage of the LUT may be reduced at thesame time of reducing the calculation complexity to achieve a purpose ofimproving the encoding and decoding efficiency.

Embodiments of the application will be described below in combinationwith the drawings in detail.

Referring to FIG. 2A, a composition block diagram example of a videocoding system according to embodiments of the application is shown. Asshown in FIG. 2A, the video encoding system 10 includes a transformationand quantization unit 101, an intra estimation unit 102, an intraprediction unit 103, a motion compensation unit 104, a motion estimationunit 105, an inverse transformation and inverse quantization unit 106, afilter control analysis unit 107, a filter unit 108, an encoding unit109 and a decoded picture buffer unit 110, etc. The filter unit 108 mayimplement deblocking filtering and Sample Adaptive Offset (SAO)filtering. The encoding unit 109 may implement header information codingand Context-based Adaptive Binary Arithmetic Coding (CABAC). For aninput video signal, a video CB may be obtained by division of a CodingTree Unit (CTU), and then residual pixel information obtained by intraor inter prediction is processed through the transformation andquantization unit 101 to transform the video CB, including transformingthe residual information from a pixel domain to a transformation domain,and an obtained transformation coefficient is quantized to furtherreduce a bit rate. The intra estimation unit 102 and the intraprediction unit 103 are configured to perform intra prediction on thevideo CB. Exactly, the intra estimation unit 102 and the intraprediction unit 103 are configured to determine an intra prediction modeto be used to coding the video CB. The motion compensation unit 104 andthe motion estimation unit 105 are configured to execute intraprediction coding on the received video CB relative to one or moreblocks in one or more reference frames to provide time predictioninformation. Motion estimation executed by the motion estimation unit105 is a process of generating a motion vector. A motion of the video CBmay be estimated according to the motion vector, and then the motioncompensation unit 104 executes motion compensation based on the motionvector determined by the motion estimation unit 105. After the intraprediction mode is determined, the intra prediction unit 103 is furtherconfigured to provide selected intra prediction data to the encodingunit 109, and the motion estimation unit 105 also sends motion vectordata determined by calculation to the encoding unit 109. In addition,the inverse transformation and inverse quantization unit 106 isconfigured to reconstruct the video CB. A residual block isreconstructed in the pixel domain, a blocking effect artifact in thereconstructed residual block is removed through the filter controlanalysis unit 107 and the filter unit 108 and then the reconstructedresidual block is added to a predictive block in a frame of the decodedpicture buffer unit 110 to generate a reconstructed video CB. Theencoding unit 109 is configured to code various coding parameters andquantized transformation coefficients. In a CABAC-based codingalgorithm, a context content may be based on adjacent CBs and may beconfigured to code information indicating the determined intraprediction mode to output a bitstream of the video signal. The decodedpicture buffer unit 110 is configured to store the reconstructed videoCB as a prediction reference. As video signals are coded, newreconstructed video CBs may be continuously generated, and thesereconstructed video CBs may be stored in the decoded picture buffer unit110.

Referring to FIG. 2B, a composition block diagram example of a videodecoding system according to embodiments of the application is shown. Asshown in FIG. 2B, the video decoding system 20 includes a decoding unit201, an inverse transformation and inverse quantization unit 202, anintra prediction unit 203, a motion compensation unit 204, a filter unit205 and a decoded picture buffer unit 206, etc. The decoding unit 201may implement header information decoding and CABAC decoding. The filterunit 205 may implement deblocking filtering and SAO filtering. Afterencoding processing shown in FIG. 2A is performed on an input videosignal, a bitstream of the video signal is output. The bitstream isinput to the video decoding system 20, and is processed through thedecoding unit 201 at first to obtain a decoded transformationcoefficient. The transformation coefficient is processed by the inversetransformation and inverse quantization unit 202 so that a residualblock is generated in a pixel domain. The intra prediction unit 203 maybe configured to generate prediction data of a present video decodingblock based on a determined intra prediction mode and data of a previousdecoded block from a present frame or picture. The motion compensationunit 204 analyzes a motion vector and other associated syntacticelements to determine prediction information for the video decodingblock and generates, by use of the prediction information, a predictiveblock of the video decoding block that is presently decoded. Theresidual block from the inverse transformation and inverse quantizationunit 202 and the corresponding predictive block generated by the intraprediction unit 203 or the motion compensation unit 204 are summed toform a decoded video block. A blocking effect artifact in the decodedvideo signal may be removed through the filter unit 205 to improve thevideo quality. Then, the decoded video block is stored in the decodedpicture buffer unit 206. The decoded picture buffer unit 206 stores areference picture for subsequent intra prediction or motion compensationand is also configured to output a video signal, namely the recoveredvideo signal is obtained.

The method for colour component prediction in the embodiments of theapplication is mainly applied to the part of the intra prediction unit103 shown in FIG. 2A and the part of the intra prediction unit 203 shownin FIG. 2B. That is, the method for colour component prediction in theembodiments of the application may be applicable for not only the videoencoding system but also the video decoding system and may even beapplicable for the video encoding system and the video decoding systemat the same time. However, no specific limits are made in theembodiments of the application. It is also to be noted that, when thecolour component prediction method is applied to the part of the intraprediction unit 103, the “current block” specifically refers to acurrent to-be-coded block in intra prediction, and when the colourcomponent prediction method is applied to the part of the intraprediction unit 203, the “current block” specifically refers to acurrent to-be-decoded block in intra prediction.

Based on the application scenario example shown in FIG. 2A, referring toFIG. 3, a flowchart of a method for colour component predictionaccording to embodiments of the application is shown. As shown in FIG.3, the method may include the following operations.

In S301, prediction parameters of a current block are determined, theprediction parameters including a prediction mode parameter and a sizeparameter of the current block.

It is to be noted that the method is applicable for an encoder. A videosignal may be divided into multiple blocks, and each current to-be-codedblock may be called a Coding Block (CB). Here, each CB may include afirst colour component, a second colour component and a third colourcomponent. The current block is a to-be-coded block, of which the firstcolour component, second colour component and third colour component arepresently to be predicted, in the video signal.

If the first colour component of the current block is to be predictedand the first colour component is a luma component, namely ato-be-predicted colour component is the luma component, the currentblock may also be called a luma block. Or, if the second colourcomponent of the current block is to be predicted and the second colourcomponent is a chroma component, namely the to-be-predicted colourcomponent is the chroma component, the current block may also be calleda chroma block.

It is also to be noted that the prediction parameters indicate aprediction mode for the current block and parameters related to theprediction mode. Here, the prediction parameters may be determined by asimple decision strategy, for example, determined according to amagnitude of a distortion value, and may also be determined by a complexdecision strategy, for example, determined according to a RateDistortion Optimization (RDO) result. No limits are made in theembodiments of the application. Generally, the prediction parameters ofthe current block may be determined in an RDO manner.

Specifically, in some embodiments, for S301, the operation that theprediction parameters of the current block are determined may includethe following operations.

Precoding processing is performed on the current block by using multipleprediction modes to obtain rate distortion cost values corresponding toall prediction modes.

A minimum rate distortion cost value is selected from the obtainedmultiple rate distortion cost values, and a prediction parameter in theprediction mode corresponding to the minimum rate distortion cost valueis determined as the prediction parameter of the current block.

That is, on an encoder side, for the current block, precoding processingmay be performed on the current block by using the multiple predictionmodes respectively. Here, the multiple prediction modes usually includean inter prediction mode and an intra prediction mode. The intraprediction mode may further include a conventional intra prediction modeand an unconventional intra prediction mode. Specifically, theconventional intra prediction mode may include a Direct Current (DC)mode, a planar mode and an angular mode, etc., and the unconventionalintra prediction mode may include an MIP mode, a Cross-Component LinearModel (CCLM) prediction mode, an Intra Block Copy (IBC) mode and aPalette (PLT) mode, etc. The inter prediction mode may include aconventional inter prediction mode and a Geometrical partitioning forinter blocks (GEO) mode, etc.

In such a manner, after the current block is precoded by using themultiple prediction modes respectively, the rate distortion cost valuecorresponding to each prediction mode may be obtained, then the minimumrate distortion cost value is selected from the obtained multiple ratedistortion cost values, and the prediction parameter in the predictionmode corresponding to the minimum rate distortion cost value isdetermined as the prediction parameter of the current block. Inaddition, after the current block is precoded by using the multipleprediction modes respectively, a distortion value corresponding to eachprediction mode may also be obtained, then a minimum cost value isselected from the obtained multiple distortion values, and predictionparameters in the prediction mode corresponding to the minimumdistortion value are determined as the prediction parameters of thecurrent block. In such a manner, the current block is finally coded byuse of the determined prediction parameters. Under the prediction mode,a predicted residual may be relatively small, and the encodingefficiency may be improved.

In S302, when the prediction mode parameter indicates that an MIP modeis adopted to determine the intra prediction value of the current block,an MIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block aredetermined.

It is to be noted that, for the current block, if the MIP mode isadopted for the current block to determine the intra prediction value ofthe current block, the MIP input sample matrix of the current block, theMIP weight matrix of the current block and the shift factor of thecurrent block are needed to be determined. The shift factor may also becalled a shift bit number, a weight shift value and the like, and may berepresented by sW, shift or weight shift.

It should be understood that, for the MIP mode, an MIP core parameter isneeded to be configured at first. Here, in the MIP mode, the currentblock may be divided into three types according to a width and height ofthe current block, and a type of the current block, i.e., a block sizeindex value of the current block, may be represented by mipSizeId orBlocksizeIdx. For different block size index values, numbers ofreference sample (boundarySize reference samples are needed on eachside), numbers inSize of matrix multiplication input sample and numbersof matrix multiplication output sample (arranged to bepredSize×predSize) are different.

Optionally, in some embodiments, the operation that the block size indexvalue of the current block is determined according to the size parameterof the current block may include the following operations.

If both the width and height of the current block are equal to 4, theblock size index value of the current block may be set equal to 0.

Or, if both the width and height of the current block are equal to 8 orone of the width and height of the current block is equal to 4, theblock size index value of the current block may be set equal to 1.

Or, if the current block is a block in another size, the block sizeindex value of the current block may be set equal to 2.

Optionally, in some embodiments, the operation that the block size indexvalue of the current block is determined according to the size parameterof the current block may include the following operations.

If both the width and height of the current block are equal to 4, theblock size index value of the current block may be set equal to 0.

Or, if one of the width and height of the current block is equal to 4,the block size index value of the current block may be set equal to 1.

Or, if the current block is a block in another size, the block sizeindex value of the current block may be set equal to 2.

In such a manner, according to the block size index value of the currentblock and a LUT shown as Table 1, the number of reference samples of anadjacent boundary (the variable is boundarySize) and a size of anMIP-based prediction block (the variable is predSize, the size of theMIP-based prediction block is predSizexpredSize) may be determined, andthe number (represented by inSize) of input sample for an MIP matrixmultiplication operation process may be calculated. A calculationequation is as follows:

inSize=(2×boundarySize)−(mipSizeId=2)?1:0  (5).

Herein, an operation rule of an operator in the equation (5) is the sameas an operator defined in an ITU-TH.265 standard. For example, “

” is a logical “equal to” operator

TABLE 1 BlocksizeIdx boundarySize predSize 0 2 4 1 4 4 2 4 8

Therefore, according to Table 1, when a value of BlocksizeIdx is 0, avalue of boundarySize may be 2 and a value of predSize may be 4, namelyreference pixels include two pixels selected from each side. A matrixmultiplication output is a 4×4 MIP-based prediction block; or, when thevalue of BlocksizeIdx is 1, the value of boundarySize may be 4 and thevalue of predSize may be 4, namely the reference pixels include fourpixels selected from each side. The matrix multiplication output is a4×4 MIP-based prediction block; or, when the value of BlocksizeIdx is 2,the value of boundarySize may be 4 and the value of predSize may be 8,namely the reference pixels include four pixels selected from each sideand the matrix multiplication output is an 8×8 MIP-based predictionblock.

In addition, the values of boundarySize, inSize and predSize may also bedetermined at the same time according to the block size index value ofthe current block and a LUT shown as Table 2.

TABLE 2 BlocksizeIdx boundarySize inSize predSize 0 2 4 4 1 4 8 4 2 4 78

Therefore, according to Table 2, w % ben the value of BlocksizeIdx is 0,the value of boundarySize may be 2, a value of inSize may be 4 and thevalue of predSize may be 4, namely the reference pixels include twopixels selected from each side, the number of the matrix multiplicationinput samples is 4 and the matrix multiplication output is a 4×4MIP-based prediction block; or, when the value of BlocksizeIdx is 1, thevalue of boundarySize may be 4, the value of inSize may be 8 and thevalue of predSize may be 4, namely the reference pixels include fourpixels selected from each side, the number of the matrix multiplicationinput samples is 8 and the matrix multiplication output is a 4×4MIP-based prediction block; or, when the value of BlocksizeIdx is 2, thevalue of boundarySize may be 4, the value of inSize may be 7 and thevalue of predSize may be 8, namely the reference pixels include fourpixels selected from each side, the number of the matrix multiplicationinput samples is 7 and the matrix multiplication output is an 8×8MIP-based prediction block.

Furthermore, after the MIP core parameter is configured, the referencepixels are further needed to be acquired to construct the MIP inputsample matrix. Specifically, in some embodiments, the operation that theMIP input sample matrix of the current block is determined may includethe following operations.

An adjacent reference sample set of the current block is determined, theadjacent reference sample set including at least one reference samplevalue.

The adjacent reference sample set is buffered to construct an inputreference sample value set.

The MIP input sample matrix is determined according to the inputreference sample value set.

It is to be noted that a matrix multiplication input sample (representedby P) is an input for a matrix multiplication process and the matrixmultiplication output sample (represented by predMip) may be obtainedafter multiplication with a corresponding matrix. The matrixmultiplication input sample P is determined by a buffer (represented bypTemp), the block size index value (represented by BlocksizeIdx) of thecurrent block and a bit depth value (represented by BitDepth)corresponding to the to-be-predicted colour component, the number inSizeof the input reference samples in the matrix multiplication input sampleP is correlated with the block size index value of the current blockonly, and an xth input sample value (represented by P[x]) in the inputsample matrix may finally be acquired.

Here, a specific construction process of the input sample matrix P[x] isas follows.

When BlocksizeIdx=0 or 1, (1<<(BitDepth−1)) is needed to be subtractedfrom a sample value of a 0th position in pTemp to obtain a sample valueof a 0th position in the input sample matrix, represented by P[0], andthen a sample value corresponding to each position of other positions inthe input sample matrix is obtained by subtracting the value of the 0thposition in pTemp from a sample value of a corresponding position inpTemp, and may be represented by P[x], specifically as follows:

$\begin{matrix}\left\{ \begin{matrix}\left. {{p\lbrack 0\rbrack} = {{{pTemp}\lbrack 0\rbrack} - \left( {{1\; {\operatorname{<<}{(BitDepth}}}\; - 1} \right)}} \right) \\{{{p\lbrack x\rbrack} = {{{pTemp}\lbrack x\rbrack} - {{{pTemp}\lbrack 0\rbrack}\mspace{14mu} {for}\mspace{14mu} x} - 1}},\ldots \;,{{inSize} - 1}}\end{matrix} \right. & (6)\end{matrix}$

When BlocksizeIdx=2, the sample value corresponding to each position ofthe other positions in the input sample matrix is obtained bysubtracting the sample value corresponding to the 0th position in pTempfrom the sample value of the next position of the corresponding positionin pTemp, specifically as follows:

p[x]=pTemp[x+1]−pTemp[0] for x=0, . . . ,inSize−1  (7)

Still taking a 4×4 current block as an example, four values are storedin the buffer pTemp, but the number of the input samples is 4. In suchcase, four input sample values, represented by p[x], x=0, 1, 2, 3, maybe determined according to the equation (3) or the equation (4), therebyobtaining a 1×4 MIP input sample matrix.

Furthermore, a weight matrix table is pre-created in the encoder, andthe weight matrix table is stored in the encoder. Therefore, the MIPweight matrix needed to be adopted for the current block, represented bymWeight[x][y], may be determined in a table lookup manner according tothe block size index value (BlocksizeIdx) of the current block and anMIP mode index value (modeIdx). A size of the MIP weight matrixmWeight[x][y] is correlated with the block size index value of thecurrent block only, as shown in Table 3. In the MIP weight matrix, thecolumn number is the number inSize of the matrix multiplication inputsamples, and the row number is the number predSized×predSized of thematrix multiplication output samples. Therefore, the MIP weight matrixof the current block may be determined.

TABLE 3 mipSizeId Column number Row number 0 4 16 1 8 16 2 7 64

Furthermore, a shift table is also pre-created in the encoder, and theshift table is also stored in the encoder. At present, in the latest MIPversion, for different block sizes and different MIP mode index values,shifted bit numbers (i.e., shift factors) in a shift operation aredifferent. As shown in Table 4, the shift factor needed to be used formatrix multiplication may be determined in the table lookup manneraccording to the block size index value (BlocksizeIdx) of the currentblock and the MIP mode index value (modeIdx, also called modeId).

TABLE 4 modeId blocksizeIdx 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 170 6 6 6 5 6 5 5 6 5 6 6 6 6 6 5 6 5 5 1 6 6 6 6 6 6 6 6 6 7 2 6 6 6 7 56

However, on the encoder side, Table 4 is needed to be stored in acomputer memory in form of a LUT. There are costs for storage as well asa lookup process. Since the shift factor is correlated with both a blocksize of the current block and the MIP mode index value in Table 4, anoccupied memory is enlarged, and the calculation complexity is alsoincreased.

For reducing the occupied memory and reducing the calculationcomplexity, a determination manner for the shift factor is simplified inthe embodiments of the application. Specifically, in some embodiments,the shift factor of the current block may include a constant shiftfactor or a shift factor determined according to the predictionparameter.

In a possible implementation mode, the shift factor may be set equal toa fixed constant value. For example, for different block size indexvalues and different MIP mode index values, the shift factor may be setequal to 5. Or, for different block size index values and different MIPmode index values, the shift factor may be set equal to 6. Or, fordifferent block size index values and different MIP mode index values,the shift factor may be set equal to 7. In the embodiment of theapplication, a value of the constant shift factor is preferably equal to6, but no specific limits are made thereto.

In another possible implementation mode, the operation that the shiftfactor is determined according to the prediction parameter may includethe following operations.

The block size index value of the current block is determined accordingto the size parameter of the current block.

The shift factor is determined according to the block size index valueof the current block.

It is to be noted that the block size index value of the current blockmay be determined according to the size parameter of the current block.Specifically, the operation that the block size index value of thecurrent block is determined according to the size parameter of thecurrent block may include the following operations.

When both the width and height of the current block are equal to 4, theblock size index value of the current block is set equal to 0.

When both the width and height of the current block are equal to 8 orone of the width and height of the current block is equal to 4, theblock size index value of the current block is set equal to 1.

When both the width and height of the current block do not meet theabove conditions, the block size index value of the current block is setequal to 2.

In such a manner, after the block size index value of the current blockis determined, the shift factor may further be determined according tothe block size index value of the current block in combination with thenumber of the MIP input sample values or the size of the MIP-basedprediction block.

Optionally, in some embodiments, the operation that the shift factor isdetermined according to the block size index value of the current blockmay include the following operation.

The shift factor is set equal to a ratio of the width or height of thecurrent block to a first preset value corresponding to the block sizeindex value of the current block.

Here, the first preset value represents the number of MIP input samplevalues obtained from a boundary of the current block. In such case, themethod may further include the following operation.

When the block size index value of the current block is equal to 0, 1and 2 respectively, it is determined that the first preset valuecorresponding to the block size index value of the current block isequal to 2, 4 and 4 respectively.

That is, when the first preset value represents the number of the MIPinput sample values obtained from the boundary of the current block, ifthe block size index value of the current block is equal to 0, thecorresponding first preset value is equal to 2; if the block size indexvalue of the current block is equal to 1, the corresponding first presetvalue is equal to 4; and if the block size index value of the currentblock is equal to 2, the corresponding first preset value is equal to 4.Therefore, the shift factor may be determined according to the ratio ofthe width or height of the current block to the corresponding firstpreset value.

Optionally, in some embodiments, the operation that the shift factor isdetermined according to the block size index value of the current blockmay include the following operation.

The shift factor is set equal to a ratio of the width or height of thecurrent block to a second preset value corresponding to the block sizeindex value of the current block.

Here, the second preset value represents the size of the MIP-basedprediction block, obtained by direct use of the MIP weight matrix, ofthe current block. In such case, the method may further include thefollowing operation.

When the block size index value of the current block is equal to 0, 1and 2 respectively, it is determined that the second preset valuecorresponding to the block size index value of the current block isequal to 4, 4 and 8 respectively.

That is, when the second preset value represents the size of theMIP-based prediction block, obtained by directly using the MIP weightmatrix for calculation, of the current block, if the block size indexvalue of the current block is equal to 0, the corresponding secondpreset value is equal to 4; if the block size index value of the currentblock is equal to 1, the corresponding second preset value is equal to4; and if the block size index value of the current block is equal to 2,the corresponding second preset value is equal to 8. Therefore, theshift factor may be determined according to the ratio of the width orheight of the current block to the corresponding second preset value.

In another possible implementation mode, the shift table may beminimized, and the shift factor is still determined in the table lookupmanner. Optionally, in some embodiments, for S302, the method mayfurther include the following operations.

The block size index value of the current block is determined accordingto the size parameter of the current block.

A shift factor corresponding to the determined block size index value isqueried in a first preset LUT according to the determined block sizeindex value, the first preset LUT being configured to recordcorresponding values of the block size index values and the shiftfactors.

The queried shift factor is determined as the shift factor of thecurrent block.

It is to be noted that the shift factor may be queried according to theblock size index value (represented by blocksizeIdx) of the currentblock only. In the first preset LUT shown as Table 5, each block sizeindex value may correspond to a fixed shift factor. That is, there isfixed shift value shown in Table 5 for a size of each block or a sizeset of each block. Here, blocksizeIdx is a block size index valuecorresponding to the size of the current block or a size of a group ofblocks.

TABLE 5 blocksizeIdx weight shift 0 5 1 6 2 6

In another possible implementation mode, the shift table may also beminimized, and the shift factor is still determined in the table lookupmanner. Optionally, in some embodiments, For S302, the method mayfurther include the following operations.

When the prediction mode parameter indicates that the MIP mode isadopted to determine the intra prediction value of the current block, anMIP mode category index value of the current block is determined.

A shift factor corresponding to the determined MIP mode category indexvalue is queried in a second preset LUT according to the determined MIPmode category index value, the second preset LUT being configured torecord corresponding values of the MIP mode category index values andthe shift factors.

The queried shift factor is determined as the shift factor of thecurrent block.

It is to be noted that the shift factor may be queried according to theMIP mode category index value (represented by ModeCategoryIdx) of thecurrent block only. In the second preset LUT shown as Table 6, each MIPmode category index value may correspond to a fixed shift factor. Thatis, the fixed shift value shown in Table 6 may be executed according toModeCategoryIdx. Here, ModeCategoryIdx is a category index valuecorresponding to the MIP mode or a set of MIP modes.

TABLE 6 ModeCategoryIdx weight shift 0 5 1 6 2 7

Furthermore, ModeCategoryIdx may be deduced according to the MIP modeindex value. Specifically, the operation that the MIP mode categoryindex value of the current block is determined may include the followingoperations.

The block size index value corresponding to the current block and theMIP mode index value when the MIP mode is adopted for prediction aredetermined.

The MIP mode category index value of the current block is determinedaccording to the block size index value and the MIP mode index value.

That is, after the block size index value of the current block and theMIP mode index value are obtained, the MIP mode category index value maybe calculated in a hash manner, or the MIP mode category index value mayalso be determined according to a condition judgment.

Optionally, the MIP mode category index value is calculated in the hashmanner. In some embodiments, the operation that the MIP mode categoryindex value of the current block is determined according to the blocksize index value and the MIP mode index value may include the followingoperations.

When the block size index value is equal to 0, right shift processing isperformed on the MIP mode index value by use of a first preset shiftvalue to obtain the MIP mode category index value of the current block.

Or, when the block size index value is equal to 1, right shiftprocessing is performed on the MIP mode index value by use of the firstpreset shift value to obtain a right-shifted value, and superimpositionprocessing is performed on the right-shifted value and a third presetvalue to obtain the MIP mode category index value of the current block.

Or, when the block size index value is equal to 2, right shiftprocessing is performed on the MIP mode index value by use of a secondpreset shift value to obtain the MIP mode category index value of thecurrent block.

It is to be noted that the first preset shift value may be 3, the secondpreset shift value may be 2 and the third preset value may be 1.

Exemplarily, when the block size index value (blocksizeIdx) is equal to0, the MIP mode index value (modeIdx) may be shifted to the right by 3to obtain the MIP mode category index value; when the block size indexvalue (blocksizeIdx) is equal to 1, the MIP mode index value (modeIdx)may be shifted to the right by 3, and then a result is superimposed with1 to obtain the MIP mode category index value; and when the block sizeindex value (blocksizeIdx) is equal to 2, the MIP mode index value(modeIdx) may be shifted to the right by 2 to obtain the MIP modecategory index value, specifically as follows:

ModeCategoryIdx=ModeIdx>>3. for blocksizeIdx=0

ModeCategoryIdx=(ModeIdx>>3)+1. for blocksizeIdx=1

ModeCategoryIdx=ModeIdx>>2. for blocksizeIdx=2

Optionally, the MIP mode category index value is determined according tothe condition judgment. In some embodiments, the operation that the MIPmode category index value of the current block is determined accordingto the block size index value and the MIP mode index value may includethe following operations.

When the block size index value is equal to 0, if the MIP mode indexvalue is less than or equal to a first threshold value, it is determinedthat the MIP mode category index value is a fourth preset value, or, ifthe MIP mode index value is greater than the first threshold value, itis determined that the MIP mode category index value is a fifth presetvalue.

Or, when the block size index value is equal to 1, if the MIP mode indexvalue is less than or equal to a second threshold value, it isdetermined that the MIP mode category index value is a sixth presetvalue; or, if the MIP mode index value is greater than the secondthreshold value, it is determined that the MIP mode category index valueis a seventh preset value.

Or, when the block size index value is equal to 2, if the MIP mode indexvalue is less than or equal to a third threshold value, it is determinedthat the MIP mode category index value) is an eighth preset value; ifthe MIP mode index value is greater than the third threshold value andthe MIP mode index value is less than or equal to a fourth thresholdvalue, it is determined that the MIP mode category index value is aninth preset value; or, if the MIP mode index value is greater than thefourth threshold value, it is determined that the MIP mode categoryindex value is a tenth preset value.

It is to be noted that the first threshold value may be 6, the secondthreshold value may be 8, the third threshold value may be 3, the fourththreshold value may be 4, the fourth preset value may be 5, the fifthpreset value may be 6, the sixth preset value may be 6, the seventhpreset value may be 7, the eighth preset value may be 5, the ninthpreset value may be 6 and the tenth preset value may be 7.

Exemplarily, when the block size index value (blocksizeIdx) is equal to0, if the MIP mode index value (modeIdx) is less than or equal to 6, theMIP mode category index value is set equal to 5, otherwise the MIP modecategory index value is set equal to 6. When the block size index value(blocksizeIdx) is equal to 1, if the MIP mode index value (modeIdx) isless than or equal to 8, the MIP mode category index value is set equalto 6, otherwise the MIP mode category index value is set equal to 7.When the block size index value (blocksizeIdx) is equal to 2, if the MIPmode index value (modeIdx) is less than or equal to 3, the MIP modecategory index value is set equal to 5: if the MIP mode index value(modeIdx) is less than or equal to 4, the MIP mode category index valueis set equal to 6; otherwise the MIP mode category index value is equalto be 7, specifically as follows:

If ModeIdx<=6, ModeCategoryIdx=5, otherwise ModeCategoryIdx=6, forblocksizeIdx=0

If ModeIdx<=8, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, forblocksizeIdx=1

If ModeIdx<=3. ModeCategoryIdx=5, else if ModeIdx<=4, ModeCategoryIdx=6,otherwise ModeCategoryIdx=7, for blocksizeIdx=2

It is also to be noted that the first threshold value may be 6, thesecond threshold value may be 8, the third threshold value may be 3, thefourth threshold value may be 4, the fourth preset value may be 0, thefifth preset value may be 1, the sixth preset value may be 1, theseventh preset value may be 2, the eighth preset value may be 0, theninth preset value may be 1 and the tenth preset value may be 2.

Exemplarily, when the block size index value (blocksizeIdx) is equal to0, if the MIP mode index value (modeIdx) is less than or equal to 6, theMIP mode category index value is set equal to 0, otherwise the MIP modecategory index value is set equal to 1. When the block size index value(blocksizeIdx) is equal to 1, if the MIP mode index value (modeIdx) isless than or equal to 8, the MIP mode category index value is set equalto 1, otherwise the MIP mode category index value is set equal to 2.When the block size index value (blocksizeIdx) is equal to 2, if the MIPmode index value (modeIdx) is less than or equal to 3, the MIP modecategory index value is set equal to 0; if the MIP mode index value(modeIdx) is less than or equal to 4, the MIP mode category index valueis set equal to 1; otherwise the MIP mode category index value is setequal to 2, specifically as follows:

If ModeIdx<=6, ModeCategoryIdx=, otherwise ModeCategoryIdx=1, forblocksizeIdx=0

If ModeIdx<=8, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, forblocksizeIdx=1

If ModeIdx<=3. ModeCategoryIdx=0, else if ModeIdx<=4, ModeCategoryIdx=,otherwise ModeCategotyIdx=2, for blocksizeIdx=2

In the above implementation mode, storage of a minimized LUT may beimplemented by simplifying the determination manner for the shiftfactor, particularly minimizing the shift table, so that the memoryoccupied by storage of the shift table in the MIP mode may be reducedwithout increasing the calculation complexity.

Therefore, in the MIP mode, the MIP input sample matrix, the MIP weightmatrix and the shift factor may be obtained to subsequently determinethe intra prediction value of the current block.

In S303, the intra prediction value of the current block is determinedaccording to the MIP weight matrix, the shift factor and the MIP inputsample matrix.

It is to be noted that, after the MIP input sample matrix, the MIPweight matrix and the shift factor are obtained, the MIP-basedprediction block of the current block may be determined at first andthen the intra prediction value of the current block is determined.Specifically, in some embodiments, for S303, the operation that theintra prediction value of the current block is determined according tothe MIP weight matrix, the shift factor and the MIP input sample matrixmay include the following operations.

Matrix multiplication processing is performed on the MIP input samplematrix, the MIP weight matrix and the shift factor by use of a presetcalculation model to obtain the MIP-based prediction block of thecurrent block.

Filtering processing is performed on the MIP-based prediction block toobtain the intra prediction value of the current block, the MIP-basedprediction block including prediction values of at least part of pixelpositions in the current block.

That is, after the MIP input sample matrix, the MIP weight matrix andthe shift factor are obtained, the MIP-based prediction block of thecurrent block may be determined at first by use of the presetcalculation model. The MIP-based prediction block includes predictionvalues of at least part of pixel positions in the current block.

Specifically, in the MIP mode, the MIP weight matrix (represented bymWeight), the shift factor (represented by sW) and an offset value(represented by f) may be determined according to the block size indexvalue (represented by blocksizeIdx) of the current block and the MIPmode index value (modeIdx). Then, the MIP input sample matrix(represented by P[x]), mWeight, sW and f are input to the matrixmultiplication process to obtain the MIP-based prediction block(represented by predMip[x][y]) output by matrix multiplication, andsamples in predMip[x][y] are arranged in a matrix form according topredSizexpredSize. The calculation model is as follows:

$\begin{matrix}\left\{ \begin{matrix}{\left. {{oW} = \left( {{1{\operatorname{<<}{(s}}\; W}\; - 1} \right)} \right) - {{fO} \times \left( {\sum_{i = 0}^{{inSize} - 1}{p\lbrack i\rbrack}} \right)}} \\{{{{predMip}\lbrack x\rbrack}\lbrack y\rbrack} = \left( \left( \left( {\sum_{i = 0}^{{inSize} - 1}{{mWeight}\lbrack i\rbrack}} \right. \right. \right.} \\{\left. {\left. {\left\lbrack {y \times \left\lbrack {{predSize} + x} \right\rbrack \times {p\lbrack i\rbrack}} \right) + {oW}} \right)\operatorname{>>}{sW}} \right) + {{pTemp}\lbrack 0\rbrack}}\end{matrix} \right. & (8)\end{matrix}$

[x][y] represents a position coordinate of a pixel, x representing ahorizontal direction and y representing a vertical direction, inSizerepresents the number of the input samples, and predSize represents aside length of the MIP-based prediction block predMip. Here, predSize iscorrelated with the type mipSizeId of the current block only. WhenmipSizeId=0 or 1, the output MIP-based prediction block is 4×4, andpredSize is equal to 4. When mipSizeId=2, the output MIP-basedprediction block is 8×8, and predSize is equal to B. Therefore, atemporary prediction value of at least one pixel in the MIP-basedprediction block predMip may be calculated according to the equation (8)to obtain the MIP-based prediction block.

Furthermore, it is also necessary to perform embedding processing on aprediction sample value in the MIP-based prediction block to obtain theMIP-based prediction block of the current block. Then, whether toperform transposition processing on the MIP-based prediction block isjudged. If a judgment result is YES, it is further necessary to performtransposition processing on the prediction sample value in the MIP-basedprediction block, and the transposed MIP-based prediction block isdetermined as the MIP-based prediction block of the current block. Ifthe judgment result is NO, it is unnecessary to perform transpositionprocessing on the prediction sample value in the MIP-based predictionblock, and the MIP-based prediction block may be directly determined asthe MIP-based prediction block of the current block.

Furthermore, in some embodiments, the operation that filteringprocessing is performed on the MIP-based prediction block to obtain theintra prediction value of the current block may include the followingoperations.

Whether a size of the MIP-based prediction block is the same as the sizeof the current block is judged.

When the size of the MIP-based prediction block is the same as the sizeof the current block, an intra predicted block of the current block isset equal to the MIP-based prediction block, the MIP-based predictionblock including prediction sample values of all pixel positions in thecurrent block.

When the size of the MIP-based prediction block is different from thesize of the current block, filtering processing is performed on theMIP-based prediction block to obtain a filtered prediction block, andthe filtered prediction block is set as the intra prediction block ofthe current block.

Here, filtering processing may include up-sampling filtering processingor low-pass filtering processing.

It should be understood that, after the MIP-based prediction block isobtained, since the MIP-based prediction block may have two sizes: a 4×4MIP-based prediction block and an 8×8 MIP-based prediction block, thesize of the current block may be the same as or different from the sizeof the MIP-based prediction block. That is, the current block may notalways be filled up with the sample values corresponding to theMIP-based prediction block and thus an up-sampling operation may beneeded to be executed on the MIP-based prediction block to generate afinal prediction value, namely whether the size of the MIP-basedprediction block is the same as the size of the current block is judgedto determine whether to perform up-sampling processing on the MIP-basedprediction block.

It is to be noted that, when the size of the MIP-based prediction blockis the same as the size of the current block, namely both a width andheight of the MIP-based prediction block are the same as those of thecurrent block, it is indicated that up-sampling processing is notrequired to be performed on the MIP-based prediction block. In suchcase, the current block is directly filled with the MIP-based predictionblock, namely there are no vacant pixels in the filled current block,and an intra prediction value of each pixel in the current block may bedirectly set equal to a predicted value of each pixel in the MIP-basedprediction block, as follows:

predSamples[x][y]=predMip[x][y]  (9)

[x][y] represents a position coordinate of a pixel, x representing thehorizontal direction and y representing the vertical direction,predSamples[x][y] represents an intra prediction value corresponding tothe pixel with the position coordinate [x][y] in the current block, andpredMip[x][y] represents a prediction value corresponding to the pixelwith the position coordinate [x][y] in the MIP-based prediction block.Therefore, the MIP-based prediction block predMip[x][y] may be directlydetermined as the intra prediction block predSamples[x][y] of thecurrent block according to the equation (9).

It is also to be noted that, when the size of the MIP-based predictionblock is different from the size of the current block, namely at leastone of the width and height of the MIP-based prediction block isdifferent from that of the current block, the current block may not befilled up with the MIP-based prediction block, namely there are vacantpixels in the filled current block. This indicates that filteringprocessing is needed to be performed on the MIP-based prediction block.That is, if up-sampling processing is needed to be performed in both thehorizontal direction and the vertical direction, horizontal up-samplingmay be performed on the MIP-based prediction block at first and thenvertical up-sampling may be performed, so that a first up-sampled block,may be represented by predSamples[x][y], is obtained. Then, verticalup-sampling is performed on the MIP-based prediction block and thenhorizontal up-sampling is performed, so that a second up-sampled block,may be represented by predSamplesTemp[x][y], is obtained. Finally,weighted mean calculation is performed on predSamples[x][y] andpredSamples[x][y] to finally obtain the intra predicted block of thecurrent block.

Exemplarily, when side lengths nTbS (here, S may be represented by W andH respectively) of the current block are all equal to the side lengthpredSize (here, predSize is correlated with blocksizeIdx of the currentblock only) of predMip, the MIP-based prediction block may be directlyset as the intra predicted block of the current block, otherwisefiltering processing is needed to be performed on the MIP-basedprediction block to obtain the intra predicted block of the currentblock. A generation process of the intra prediction block may refer toFIG. 4. Still taking a 4-4 current block as an example, in FIG. 4, sincethe sizes of the current block and the MIP-based prediction block arethe same, filtering processing is not needed to be performed on theMIP-based prediction block, and the MIP-based prediction block may bedirectly set as the intra prediction block of the current block, so thatan intra prediction value of at least one pixel in the current block maybe obtained.

The embodiment provides a method for colour component prediction, whichis applicable for an encoder. Prediction parameters of a current blockare determined, the prediction parameters including a prediction modeparameter and a size parameter of the current block. When the predictionmode parameter indicates that an MIP mode is adopted to determine anintra prediction value of the current block, an MIP weight matrix of thecurrent block, a shift factor of the current block and an MIP inputsample matrix of the current block are determined. The intra predictionvalue of the current block is determined according to the MIP weightmatrix, the shift factor and the MIP input sample matrix. In such amanner, a determination manner for the shift factor may be simplified,and moreover, when the shift factor is determined by use of a LUT, amemory occupied by storage of the LUT may be reduced at the same time ofreducing the calculation complexity to achieve a purpose of improvingthe encoding efficiency.

Based on the application scenario example shown in FIG. 2B, referring toFIG. 5, a flowchart of another method for colour component predictionaccording to embodiments of the application is shown. As shown in FIG.5, the method may include the following operations.

In S501, a bitstream is parsed to acquire prediction parameters of acurrent block, the prediction parameters including a prediction modeparameter and a size parameter of the current block.

It is to be noted that the method is applicable for a decoder. A videosignal may be divided into multiple blocks. Each current to-be-decodedpicture block may be called a decoding block. Here, each decoding blockmay include a first colour component, a second colour component and athird colour component. The current block is a to-be-decoded block, ofwhich the first colour component, second colour component and thirdcolour component are presently to be predicted, in the video signal.

It is also to be noted that the prediction parameter is configured toindicate a prediction mode for the current block and parameters relatedto the prediction mode. The prediction mode usually includes an interprediction mode, a conventional intra prediction mode and anunconventional intra prediction mode, etc. The unconventional intraprediction mode further includes an MIP mode, a CCLM mode, an IBC modeand a PLT mode, etc. That is, an encoder may select an optimalprediction mode to precode the current block, and in this process, theprediction mode for the current block may be determined, thereby writingprediction parameters in the prediction mode into the bitstream fortransmission to the decoder by the encoder.

Therefore, on a decoder side, the bitstream may be parsed to acquire theprediction parameters of the current block, and the prediction modeparameter in the prediction parameters acquired by parsing may beconfigured to determine whether the MIP mode is adopted for the currentblock.

In S502, when the prediction mode parameter indicates that an MIP modeis adopted to determine an intra prediction value of the current block,an MIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block aredetermined.

It is to be noted that, for the current block, if the MIP mode isadopted for the current block to determine the intra prediction value ofthe current block, the MIP input sample matrix of the current block, theMIP weight matrix of the current block and the shift factor of thecurrent block are needed to be determined. The shift factor may also becalled a shifted bit number, a weight shift value and the like, and maybe represented by sW, shift or weight shift.

In some embodiments, the shift factor of the current block may include aconstant shift factor or a shift factor determined according to theprediction parameter.

In a possible implementation mode, the shift factor may be set equal toa fixed constant value. In the embodiment of the application, a value ofthe constant shift factor is preferably equal to 6, but no specificlimits are made thereto.

In another possible implementation mode, the operation that the shiftfactor is determined according to the prediction parameter may includethe following operations.

A block size index value of the current block is determined according tothe size parameter of the current block.

The shift factor is determined according to the block size index valueof the current block.

It is to be noted that the block size index value (represented bymipSizeId or blocksizeIdx) of the current block may be determinedaccording to the size parameter of the current block. Specifically, theoperation that the block size index value of the current block isdetermined according to the size parameter of the current block mayinclude the following operations.

When both a width and height of the current block are equal to 4, theblock size index value of the current block is set equal to 0.

When both the width and height of the current block are equal to 8 orone of the width and height of the current block is equal to 4, theblock size index value of the current block is set equal to 1.

When both the width and height of the current block do not meet theabove conditions, the block size index value of the current block is setequal to 2.

In such a manner, after the block size index value of the current blockis determined, the shift factor may further be determined according tothe block size index value of the current block in combination with thenumber of MIP input sample values or a size of an MIP-based predictionblock.

Optionally, in some embodiments, the operation that the shift factor isdetermined according to the block size index value of the current blockmay include the following operation.

The shift factor is set equal to a ratio of the width or height of thecurrent block to a first preset value corresponding to the block sizeindex value of the current block.

Here, the first preset value represents the number of MIP input samplevalues obtained from a boundary of the current block. In such case, themethod may further include the following operation.

When the block size index value of the current block is equal to 0, 1and 2 respectively, it is determined that the first preset valuecorresponding to the block size index value of the current block isequal to 2, 4 and 4 respectively.

That is, when the first preset value represents the number of the MIPinput sample values obtained from the boundary of the current block, ifthe block size index value of the current block is equal to 0, thecorresponding first preset value is equal to 2; if the block size indexvalue of the current block is equal to 1, the corresponding first presetvalue is equal to 4: and if the block size index value of the currentblock is equal to 2, the corresponding first preset value is equal to 4.Therefore, the shift factor may be determined according to the ratio ofthe width or height of the current block to the corresponding firstpreset value.

Optionally, in some embodiments, the operation that the shift factor isdetermined according to the block size index value of the current blockmay include the following operation.

The shift factor is set equal to a ratio of the width or height of thecurrent block to a second preset value corresponding to the block sizeindex value of the current block.

Here, the second preset value represents the size of the MIP-basedprediction block, obtained by direct use of the MIP weight matrix, ofthe current block. In such case, the method may further include thefollowing operation.

When the block size index value of the current block is equal to 0, 1and 2 respectively, it is determined that the second preset valuecorresponding to the block size index value of the current block isequal to 4, 4 and 8 respectively.

That is, when the second preset value represents the size of theMIP-based prediction block, obtained by direct use of the MIP weightmatrix, of the current block, if the block size index value of thecurrent block is equal to 0, the corresponding second preset value isequal to 4; if the block size index value of the current block is equalto 1, the corresponding second preset value is equal to 4; and if theblock size index value of the current block is equal to 2, thecorresponding second preset value is equal to 8. Therefore, the shiftfactor may be determined according to the ratio of the width or heightof the current block to the corresponding second preset value.

In another possible implementation mode, a shift table may be minimized,and the shift factor is still determined in a table lookup manner.Optionally, in some embodiments, for S502, the method further includesthe following operations.

The block size index value of the current block is determined accordingto the size parameter of the current block.

A shift factor corresponding to the determined block size index value isqueried in a first preset LUT according to the determined block sizeindex value, the first preset LUT being configured to recordcorresponding values of the block size index values and the shiftfactors.

The queried shift factor is determined as the shift factor of thecurrent block.

It is to be noted that the shift table (for example, the first presetLUT or a second preset LUT) is also pre-created in the decoder and theshift table is also stored in the decoder. Therefore, when the shiftfactor is queried according to the block size index value of the currentblock only, the first preset LUT shown as Table 5 may be adopted. InTable 5, each block size index value may correspond to a fixed shiftfactor. That is, there is a fixed shift value shown in Table 5 for asize of each block or a size set of each block.

In another possible implementation mode, the shift table may also beminimized, and the shift factor is still determined in the table lookupmanner. Optionally, in some embodiments, for S502, the method mayfurther include the following operations.

When the prediction mode parameter indicates that the MIP mode isadopted to determine the intra prediction value of the current block, anMIP mode category index value of the current block is determined.

A shift factor corresponding to the determined MIP mode category indexvalue is queried in a second preset LUT according to the determined MIPmode category index value, the second preset LUT being configured torecord corresponding values of the MIP mode category index values andthe shift factors.

The queried shift factor is determined as the shift factor of thecurrent block.

It is to be noted that, when the shift factor is queried according tothe MIP mode category index value (represented by ModeCategoryIdx) ofthe current block only, the second preset LUT shown as Table 6 may beadopted. In Table 6, each MIP mode category index value may correspondto a fixed shift factor. That is, a fixed shift value shown in Table 6may be executed according to ModeCategoryIdx.

Furthermore, ModeCategoryIdx may be deduced according to the MIP modeindex value. Specifically, the operation that the MIP mode categoryindex value of the current block is determined may include the followingoperations.

The block size index value corresponding to the current block and theMIP mode index value when the MIP mode is adopted for prediction aredetermined according to the prediction parameter.

The MIP mode category index value of the current block is determinedaccording to the block size index value and the MIP mode index value.

That is, after the block size index value of the current block and theMIP mode index value are obtained, the MIP mode category index value maybe calculated in a hash manner, or the MIP mode category index value mayalso be determined according to a condition judgment.

Optionally, the MIP mode category index value is calculated in the hashmanner. In some embodiments, the operation that the MIP mode categoryindex value of the current block is determined according to the blocksize index value and the MIP mode index value includes the followingoperations.

When the block size index value is equal to 0, right shift processing isperformed on the MIP mode index value by use of a first preset shiftvalue to obtain the MIP mode category index value of the current block.

Or, when the block size index value is equal to 1, right shiftprocessing is performed on the MIP mode index value by use of the firstpreset shift value to obtain a right-shifted value, and superimpositionprocessing is performed on the right-shifted value and a third presetvalue to obtain the MIP mode category index value of the current block.

Or, when the block size index value is equal to 2, right shiftprocessing is performed on the MIP mode index value by use of a secondpreset shift value to obtain the MIP mode category index value of thecurrent block.

Exemplarily, the first preset shift value may be 3, the second presetshift value may be 2 and the third preset value may be 1, specificallyas follows:

ModeCategoryIdx=ModeIdx>>3. for blocksizeIdx=0

ModeCategoryIdx=(ModeIdx>>3)+1. for blocksizeIdx=1

ModeCategoryIdx=ModeIdx>>2. for blocksizeIdx=2

Optionally, the MIP mode category index value is determined according tothe condition judgment. In some embodiments, the operation that the MIPmode category index value of the current block is determined accordingto the block size index value and the MIP mode index value includes thefollowing operations.

When the block size index value is equal to 0, if the MIP mode indexvalue is less than or equal to a first threshold value, it is determinedthat the MIP mode category index value is a fourth preset value; if theMIP mode index value is greater than the first threshold value, it isdetermined that the MIP mode category index value is a fifth presetvalue.

Or, when the block size index value is equal to 1, if the MIP mode indexvalue is less than or equal to a second threshold value, it isdetermined that the MIP mode category index value is a sixth presetvalue; if the MIP mode index value is greater than the second thresholdvalue, it is determined that the MIP mode category index value is aseventh preset value.

Or, when the block size index value is equal to 2, if the MIP mode indexvalue is less than or equal to a third threshold value, it is determinedthat the MIP mode category index value is an eighth preset value; if theMIP mode index value is greater than the third threshold value and theMIP mode index value is less than or equal to a fourth threshold value,it is determined that the MIP mode category index value is a ninthpreset value; if the MIP mode index value is greater than the fourththreshold value, it is determined that the MIP mode category index valueis a tenth preset value.

Exemplarily, the first threshold value may be 6, the second thresholdvalue may be 8, the third threshold value may be 3 and the fourththreshold value may be 4.

When the fourth preset value may be 5, the fifth preset value may be 6,the sixth preset value may be 6, the seventh preset value may be 7, theeighth preset value may be 5, the ninth preset value may be 6 and thetenth preset value is 7, specific representations are as follows:

If ModeIdx<=6, ModeCategoryIdx=5, otherwise ModeCategoryIdx=6, forblocksizeIdx=0

If ModeIdx<=8, ModeCategoryIdx=6, otherwise ModeCategoryIdx=7, forblocksizeIdx=1

If ModeIdx<=3, ModeCategoryIdx=5, else if ModeIdx<=4, ModeCategoryIdx=6,otherwise ModeCategoryIdx=7, for blocksizeIdx=2

Or, when the fourth preset value may be 0, the fifth preset value may be1, the sixth preset value may be 1, the seventh preset value may be 2,the eighth preset value may be 0, the ninth preset value may be 1 andthe tenth preset value is 2, specific representations are as follows:

If ModeIdx<=6, ModeCategoryIdx=0, otherwise ModeCategoryIdx=1, forblocksizeIdx=0

If ModeIdx<=8, ModeCategoryIdx=1, otherwise ModeCategoryIdx=2, forblocksizeIdx=1

If ModeIdx<=3, ModeCategoryIdx=0, else if ModeIdx<=4. ModeCategoryIdx=1,otherwise ModeCategoryIdx=2, for blocksizeIdx=2

In the implementation mode, storage of a minimized LUT may beimplemented by simplifying the determination manner for the shiftfactor, particularly by minimizing the shift table, so that the memoryoccupied by storage of the shift table in the MIP mode may be reducedwithout increasing the calculation complexity.

Therefore, in the MIP mode, the MIP input sample matrix and the MIPweight matrix may also be obtained to subsequently determine the intraprediction value of the current block.

In S503, the intra prediction value of the current block is determinedaccording to the MIP weight matrix, the shift factor and the MIP inputsample matrix.

It is to be noted that, after the MIP input sample matrix, the MIPweight matrix and the shift factor are obtained, the MIP-basedprediction block of the current block may be determined at first andthen the intra prediction value of the current block is determined.Specifically, in some embodiments, for S503, the operation that theintra prediction value of the current block is determined according tothe MIP weight matrix, the shift factor and the MIP input sample matrixmay include the following operations.

Matrix multiplication processing is performed on the MIP input samplematrix, the MIP weight matrix and the shift factor by use of a presetcalculation model to obtain the MIP-based prediction block of thecurrent block.

Filtering processing is performed on the MIP-based prediction block toobtain the intra prediction value of the current block, the MIP-basedprediction block including prediction values of at least part of pixelpositions in the current block.

That is, after the MIP input sample matrix, the MIP weight matrix andthe shift factor are obtained, the MIP-based prediction block of thecurrent block may be determined at first, and then whether the size ofthe MIP-based prediction block is the same as the size of the currentblock may further be determined according to the obtained MIP-basedprediction block to further determine the intra prediction value of thecurrent block. Specifically, according to a judgment result, when thesize of the MIP-based prediction block is the same as the size of thecurrent block, an intra prediction block of the current block is setequal to the MIP-based prediction block, and in such case, the MIP-basedprediction block includes prediction sample values of all pixelpositions in the current block. When the size of the MIP-basedprediction block is different from the size of the current block,filtering processing is performed on the MIP-based prediction block toobtain a filtered prediction block, and the filtered prediction block isset as the intra prediction block of the current block. Here, filteringprocessing may include up-sampling filtering processing or low-passfiltering processing.

The embodiment provides a method for colour component prediction, whichis applicable for a decoder. A bitstream is parsed to acquire predictionparameters of a current block, the prediction parameters including aprediction mode parameter and a size parameter of the current block;when the prediction mode parameter indicates that an MIP mode is adoptedto determine an intra prediction value of the current block, an MIPweight matrix of the current block, a shift factor of the current blockand an MIP input sample matrix of the current block are determined; andthe intra prediction value of the current block is determined accordingto the MIP weight matrix, the shift factor and the MIP input samplematrix. In such a manner, a determination manner for the shift factormay be simplified, and moreover, when the shift factor is determined byuse of a LUT, a memory occupied by storage of the LUT may be reduced atthe same time of reducing the calculation complexity to achieve apurpose of improving the decoding efficiency.

Based on the same inventive concept of the abovementioned embodiments,referring to FIG. 6, a composition structure diagram of an encoder 60according to embodiments of the application is shown. As shown in FIG.6, the encoder 60 may include a first determination unit 601 and a firstprediction unit 602.

The first determination unit 601 is configured to determine predictionparameters of a current block, the prediction parameters including aprediction mode parameter and a size parameter of the current block.

The first determination unit 601 is further configured to, when theprediction mode parameter indicates that an MIP mode is adopted todetermine an intra prediction value of the current block, determine anMIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block.

The first prediction unit 602 is configured to determine the intraprediction value of the current block according to the MIP weightmatrix, the shift factor and the MIP input sample matrix.

In some embodiments, the shift factor of the current block includes aconstant shift factor or a shift factor determined according to theprediction parameter.

In some embodiments, a value of the constant shift factor is equal to 6.

In some embodiments, the first determination unit 601 is furtherconfigured to determine a block size index value of the current blockaccording to the size parameter of the current block and determine theshift factor according to the block size index value of the currentblock.

In some embodiments, referring to FIG. 7, the encoder 60 may furtherinclude a first setting unit 603, configured to set the block size indexvalue of the current block equal to 0 when both a width and height ofthe current block are equal to 4; set the block size index value of thecurrent block equal to 1 when both the width and height of the currentblock are equal to 8 or one of the width and height of the current blockis equal to 4: and set the block size index value of the current blockequal to 2 when the width and height of the current block do not meetthe above conditions.

In some embodiments, the first setting unit 603 is further configured toset the shift factor equal to a ratio of the width or height of thecurrent block to a first preset value corresponding to the block sizeindex value of the current block.

In some embodiments, the first preset value represents the number of MIPinput sample values obtained from a boundary of the current block.

In some embodiments, the first determination unit 601 is furtherconfigured to, when the block size index value of the current block isequal to 0, 1 and 2 respectively, determine that the first preset valuecorresponding to the block size index value of the current block isequal to 2, 4 and 4 respectively.

In some embodiments, the first setting unit 603 is further configured toset the shift factor equal to a ratio of the width or height of thecurrent block to a second preset value corresponding to the block sizeindex value of the current block.

In some embodiments, the second preset value represents a size of anMIP-based prediction block, obtained by direct use of the MIP weightmatrix, of the current block.

In some embodiments, the first determination unit 601 is furtherconfigured to, when the block size index value of the current block isequal to 0, 1 and 2 respectively, determine that the second preset valuecorresponding to the block size index value of the current block isequal to 4, 4 and 8 respectively.

In some embodiments, referring to FIG. 7, the encoder 60 may furtherinclude a first query unit 604.

The first determination unit 601 is further configured to determine theblock size index value of the current block according to the sizeparameter of the current block.

The first query unit 604 is configured to query a shift factorcorresponding to the determined block size index value in a first presetLUT according to the determined block size index value, the first presetLUT being configured to record corresponding values of the block sizeindex values and the shift factors, and determine the queried shiftfactor as the shift factor corresponding to the current block.

In some embodiments, the first determination unit 601 is furtherconfigured to, when the prediction mode parameter indicates that the MIPmode is adopted to determine the intra prediction value of the currentblock, determine an MIP mode category index value of the current block.

The first query unit 604 is configured to query a shift factorcorresponding to the determined MIP mode category index value in asecond preset LUT according to the determined MIP mode category indexvalue, the second preset LUT being configured to record correspondingvalues of the MIP mode category index values and the shift factors, anddetermine the queried shift factor as the shift factor corresponding tothe current block.

In some embodiments, the first determination unit 601 is specificallyconfigured to determine the block size index value corresponding to thecurrent block and an MIP mode index value when the MIP mode is adoptedfor prediction and determine the MIP mode category index value of thecurrent block according to the block size index value and the MIP modeindex value.

In some embodiments, referring to FIG. 7, the encoder 60 may furtherinclude a first calculation unit 605. The first calculation unit 605 isconfigured to, when the block size index value is equal to 0, performright shift processing on the MIP mode index value by use of a firstpreset shift value to obtain the MIP mode category index value of thecurrent block; or, when the block size index value is equal to 1,perform right shift processing on the MIP mode index value by use of thefirst preset shift value to obtain a right-shifted value and performsuperimposition processing on the right-shifted value and a third presetvalue to obtain the MIP mode category index value of the current block:or, when the block size index value is equal to 2, perform right shiftprocessing on the MIP mode index value by use of a second preset shiftvalue to obtain the MIP mode category index value of the current block.

In some embodiments, referring to FIG. 7, the encoder 60 may furtherinclude a first judgment unit 606. The first judgment unit 606 isconfigured to, when the block size index value is equal to 0, if the MIPmode index value is less than or equal to a first threshold value,determine that the MIP mode category index value is a fourth presetvalue, and if the MIP mode index value is greater than the firstthreshold value, determine that the MIP mode category index value is afifth preset value; or, when the block size index value is equal to 1,if the MIP mode index value is less than or equal to a second thresholdvalue, determine that the MIP mode category index value is a sixthpreset value, and if the MIP mode index value is greater than the secondthreshold value, determine that the MIP mode category index value is aseventh preset value; or, when the block size index value is equal to 2,if the MIP mode index value is less than or equal to a third thresholdvalue, determine that the MIP mode category index value is an eighthpreset value, if the MIP mode index value is greater than the thirdthreshold value and the MIP mode index value is less than or equal to afourth threshold value, determine that the MIP mode category index valueis a ninth preset value, and if the MIP mode index value is greater thanthe fourth threshold value, determine that the MIP mode category indexvalue is a tenth preset value.

In some embodiments, referring to FIG. 7, the encoder 60 may furtherinclude a precoding unit 607, configured to perform precoding processingon the current block in multiple prediction modes to obtain ratedistortion cost values corresponding to all prediction modes, select aminimum rate distortion cost value from the obtained multiple ratedistortion cost values and determine prediction parameters in theprediction mode corresponding to the minimum rate distortion cost valueas the prediction parameters of the current block.

In some embodiments, the first calculation unit 605 is furtherconfigured to perform matrix multiplication processing on the MIP inputsample matrix, the MIP weight matrix and the shift factor by use of apreset calculation model to obtain the MIP-based prediction block of thecurrent block.

The first prediction unit 602 is specifically configured to performfiltering processing on the MIP-based prediction block to obtain theintra prediction value of the current block, the MIP-based predictionblock including predicted values of at least part of pixel positions inthe current block.

It can be understood that, in the embodiments of the application, “unit”may be part of a circuit, part of a processor, part of a program orsoftware and the like, of course, may also be modular and may also benon-modular. In addition, each component in the embodiments may beintegrated into a processing unit, each unit may also existindependently, and two or more than two units may also be integratedinto a unit. The integrated unit may be implemented in a hardware formand may also be implemented in form of software function module.

When implemented in form of software function module and sold or usednot as an independent product, the integrated unit may be stored in acomputer-readable storage medium. Based on such an understanding, thetechnical solution of the embodiment substantially or parts makingcontributions to the conventional art or all or part of the technicalsolution may be embodied in form of software product, and the computersoftware product is stored in a storage medium, including a plurality ofinstructions configured to enable a computer device (which may be apersonal computer, a server, a network device or the like) or aprocessor to execute all or part of the steps of the method in theembodiment. The storage medium includes: various media capable ofstoring program codes such as a U disk, a mobile hard disk, a Read-OnlyMemory (ROM), a Random Access Memory (RAM), a magnetic disk or anoptical disk.

Therefore, the embodiments of the application provide a computer storagemedium, which is applicable for the encoder 60. The computer storagemedium stores computer programs, and the computer programs are executedby a first processor to implement any method in the abovementionedembodiments.

Based on the composition of the encoder 60 and the computer storagemedium, referring to FIG. 8, a specific hardware structure example ofthe encoder 60 according to the embodiments of the application is shown,and may include a first communication interface 801, a first memory 802and a first processor 803. Each component is coupled together through afirst bus system 804. It can be understood that the first bus system 804is configured to implement connection communication between thesecomponents. The first bus system 804 includes a data bus and alsoincludes a power bus, a control bus and a state signal bus. However, forclear description, various buses in FIG. 8 are marked as the first bussystem 804.

The first communication interface 801 is configured to receive and senda signal in a process of receiving and sending information with otherexternal network elements.

The first memory 802 is configured to store computer programs capable ofrunning in the first processor 803.

The first processor 803 is configured to run the computer programs toexecute the following operations.

Prediction parameters of a current block are determined, the predictionparameters including a prediction mode parameter and a size parameter ofthe current block.

When the prediction mode parameter indicates that an MIP mode is adoptedto determine an intra prediction value of the current block, an MIPweight matrix of the current block, a shift factor of the current blockand an MIP input sample matrix of the current block are determined.

The intra prediction value of the current block is determined accordingto the MIP weight matrix, the shift factor and the MIP input samplematrix.

It can be understood that the first memory 802 in the embodiments of theapplication may be a volatile memory or a nonvolatile memory, or mayinclude both the volatile and nonvolatile memories. The nonvolatilememory may be a ROM, a Programmable ROM (PROM), an Erasable PROM(EPROM), an Electrically EPROM (EEPROM) or a flash memory. The volatilememory may be a RAM, and is used as an external high-speed buffer. It isexemplarily but unlimitedly described that RAMs in various forms may beadopted, such as a Static RAM (SRAM), a Dynamic RAM (DRAM), aSynchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDRSDRAM), anEnhanced SDRAM (ESDRAM), a Synchlink DRAM (SLDRAM) and a Direct RambusRAM (DRRAM). It is to be noted that the first memory 802 of a system andmethod described in the application is intended to include, but notlimited to, memories of these and any other proper types.

The first processor 803 may be an integrated circuit chip with a signalprocessing capability. In an implementation process, each step of themethod may be completed by an integrated logic circuit of hardware inthe first processor 803 or an instruction in a software form. The firstprocessor 803 may be a universal processor, a Digital Signal Processor(DSP), an Application Specific Integrated Circuit (ASIC), a FieldProgrammable Gate Array (FPGA) or another Programmable Logic Device(PLD), discrete gate or transistor logical device and discrete hardwarecomponent. Each method, step and logical block diagram disclosed in theembodiments of the application may be implemented or executed. Theuniversal processor may be a microprocessor or the processor may also beany conventional processor and the like. The operations of the methoddisclosed in combination with the embodiments of the application may bedirectly embodied to be executed and completed by a hardware decodingprocessor or executed and completed by a combination of hardware andsoftware modules in the decoding processor. The software module may belocated in a mature storage medium in this field such as a RAM, a flashmemory, a ROM, a PROM or EEPROM and a register. The storage medium islocated in the first memory 802. The first processor 803 readsinformation in the first memory 802 and completes the operations of themethod in combination with hardware.

It can be understood that these embodiments described in the applicationmay be implemented by hardware, software, firmware, middleware, amicrocode or a combination thereof. In case of implementation with thehardware, the processing unit may be implemented in one or more ASICs,DSPs, DSP Devices (DSPDs), PLDs, FPGAs, universal processors,controllers, microcontrollers, microprocessors, other electronic unitsconfigured to execute the functions in the application or combinationsthereof. In case of implementation with the software, the technology ofthe application may be implemented through the modules (for example,processes and functions) executing the functions in the application. Asoftware code may be stored in the memory and executed by the processor.The memory may be implemented in the processor or outside the processor.

Optionally, as another embodiment, the first processor 803 is furtherconfigured to run the computer programs to execute any method in theabovementioned embodiments.

The embodiments of the application provide an encoder. The encoder mayinclude a first determination unit and a first prediction unit. Thefirst determination unit is configured to determine predictionparameters of a current block, the prediction parameters including aprediction mode parameter and a size parameter of the current block. Thefirst determination unit is further configured to, when the predictionmode parameter indicates that an MIP mode is adopted to determine anintra prediction value of the current block, determine an MIP weightmatrix of the current block, a shift factor of the current block and anMIP input sample matrix of the current block. The first prediction unitis configured to determine the intra prediction value of the currentblock according to the MIP weight matrix, the shift factor and the MIPinput sample matrix. In such a manner, a determination manner for theshift factor may be simplified, and moreover, when the shift factor isdetermined by use of a LUT, a memory occupied by storage of the LUT maybe reduced at the same time of reducing the calculation complexity toachieve a purpose of improving the encoding and decoding efficiency.

Based on the same inventive concept of the abovementioned embodiments,referring to FIG. 9, a composition structure diagram of a decoder 90according to embodiments of the application is shown. As shown in FIG.9, the decoder 90 may include a parsing unit 901, a second determinationunit 902 and a second prediction unit 903.

The parsing unit 901 is configured to parse a bitstream to acquireprediction parameters of a current block, the prediction parametersincluding a prediction mode parameter and a size parameter of thecurrent block.

The second determination unit 902 is configured to, when the predictionmode parameter indicates that an MIP mode is adopted to determine anintra prediction value of the current block, determine an MIP weightmatrix of the current block, a shift factor of the current block and anMIP input sample matrix of the current block.

The second prediction unit 903 is configured to determine the intraprediction value of the current block according to the MIP weightmatrix, the shift factor and the MIP input sample matrix.

In some embodiments, the shift factor of the current block includes aconstant shift factor or a shift factor determined according to theprediction parameters.

In some embodiments, a value of the constant shift factor is equal to 6.

In some embodiments, the second determination unit 902 is furtherconfigured to determine a block size index value of the current blockaccording to the size parameter of the current block and determine theshift factor according to the block size index value of the currentblock.

In some embodiments, referring to FIG. 10, the decoder 90 may furtherinclude a second setting unit 904. The second setting unit 904 isconfigured to, when both a width and height of the current block areequal to 4, set the block size index value of the current block equal to0, when both the width and height of the current block are equal to 8 orone of the width and height of the current block is equal to 4, set theblock size index value of the current block equal to 1; and when thewidth and height of the current block do not meet the above conditions,set the block size index value of the current block equal to 2.

In some embodiments, the second setting unit 904 is further configuredto set the shift factor equal to a ratio of the width or height of thecurrent block to a first preset value corresponding to the block sizeindex value of the current block.

In some embodiments, the first preset value represents the number of MIPinput sample values obtained from a boundary of the current block.

In some embodiments, the second determination unit 902 is furtherconfigured to, when the block size index value of the current block isequal to 0, 1 and 2 respectively determine that the first preset valuecorresponding to the block size index value of the current block isequal to 2, 4 and 4 respectively.

In some embodiments, the second setting unit 904 is further configuredto set the shift factor equal to a ratio of the width or height of thecurrent block to a second preset value corresponding to the block sizeindex value of the current block.

In some embodiments, the second preset value represents a size of anMIP-based prediction block, obtained by direct use of the MIP weightmatrix, of the current block.

In some embodiments, the second determination unit 902 is furtherconfigured to, when the block size index value of the current block isequal to 0, 1 and 2 respectively determine that the second preset valuecorresponding to the block size index value of the current block isequal to 4, 4 and 8 respectively.

In some embodiments, referring to FIG. 10, the decoder 90 may furtherinclude a second query unit 905.

The second determination unit 902 is further configured to determine theblock size index value of the current block according to the sizeparameter of the current block.

The second query unit 905 is configured to query a shift factorcorresponding to the determined block size index value in a first presetLUT according to the determined block size index value, the first presetLUT being configured to record corresponding values of the block sizeindex values and the shift factors, and determine the queried shiftfactor as the shift factor corresponding to the current block.

In some embodiments, the second determination unit 902 is furtherconfigured to, when the prediction mode parameter indicates that the MIPmode is adopted to determine the intra prediction value of the currentblock, determine an MIP mode category index value of the current block.

The second query unit 905 is configured to query a shift factorcorresponding to the determined MIP mode category index value in asecond preset LUT according to the determined MIP mode category indexvalue, the second preset LUT being configured to record correspondingvalues of the MIP mode category index values and the shift factors, anddetermine the queried shift factor as the shift factor corresponding tothe current block.

In some embodiments, the second determination unit 902 is specificallyconfigured to determine the block size index value corresponding to thecurrent block and an MIP mode index value when the MIP mode is adoptedfor prediction according to the prediction parameter and determine theMIP mode category index value of the current block according to theblock size index value and the MIP mode index value.

In some embodiments, referring to FIG. 10, the decoder 90 may furtherinclude a second calculation unit 906. The second calculation unit 906is configured to, when the block size index value is equal to 0, performright shift processing on the MIP mode index value by use of a firstpreset shift value to obtain the MIP mode category index value of thecurrent block; or, when the block size index value is equal to 1,perform right shift processing on the MIP mode index value by use of thefirst preset shift value to obtain a right-shifted value and performsuperimposition processing on the right-shifted value and a third presetvalue to obtain the MIP mode category index value of the current block;or, when the block size index value is equal to 2, perform right shiftprocessing on the MIP mode index value by use of a second preset shiftvalue to obtain the MIP mode category index value of the current block.

In some embodiments, referring to FIG. 10, the decoder 90 may furtherinclude a second judgment unit 907, configured to, when the block sizeindex value is equal to 0, if the MIP mode index value is less than orequal to a first threshold value, determine that the MIP mode categoryindex value is a fourth preset value, and if the MIP mode index value isgreater than the first threshold value, determine that the MIP modecategory index value is a fifth preset value; or, when the block sizeindex value is equal to 1, if the MIP mode index value is less than orequal to a second threshold value, determine that the MIP mode categoryindex value is a sixth preset value, and if the MIP mode index value isgreater than the second threshold value, determine that the MIP modecategory index value is a seventh preset value, or, when the block sizeindex value is equal to 2, if the MIP mode index value is less than orequal to a third threshold value, determine that the MIP mode categoryindex value is an eighth preset value, if the MIP mode index value isgreater than the third threshold value and the MIP mode index value isless than or equal to a fourth threshold value, determine that the MIPmode category index value is a ninth preset value, and if the MIP modeindex value is greater than the fourth threshold value, determine thatthe MIP mode category index value is a tenth preset value.

In some embodiments, the second calculation unit 906 is furtherconfigured to perform matrix multiplication processing on the MIP inputsample matrix, the MIP weight matrix and the shift factor by use of apreset calculation model to obtain the MIP-based prediction block of thecurrent block.

The second prediction unit 903 is specifically configured to performfiltering processing on the MIP-based prediction block to obtain theintra prediction value of the current block, the MIP-based predictionblock including predicted values of at least part of pixel positions inthe current block.

It can be understood that, in the embodiment, “unit” may be part of acircuit, part of a processor, part of a program or software and thelike, of course, may also be modular and may also be non-modular. Inaddition, each component in the embodiments may be integrated into aprocessing unit, each unit may also exist independently, and two or morethan two units may also be integrated into a unit. The integrated unitmay be implemented in a hardware form and may also be implemented inform of software function module.

When being implemented in form of a software functional module and soldor used not as an independent product, the integrated unit may be storedin a computer-readable storage medium. Based on such an understanding,the embodiments provide a computer storage medium, which is applicablefor the decoder 90. The computer storage medium stores computerprograms, and the computer programs are executed by a second processorto implement any method in the abovementioned embodiments.

Based on the composition of the decoder 90 and the computer storagemedium, referring to FIG. 11, a specific hardware structure example ofthe decoder 90 according to the embodiments of the application is shown,and may include a second communication interface 1101, a second memory1102 and a second processor 1103. Each component is coupled togetherthrough a second bus system 1104. It can be understood that the secondbus system 1104 is configured to implement connection communicationbetween these components. The second bus system 1104 includes a data busand also includes a power bus, a control bus and a state signal bus.However, for clear description, various buses in FIG. 11 are marked asthe second bus system 1104.

The second communication interface 1101 is configured to receive andsend a signal in a process of receiving and sending information withanother external network element.

The second memory 1102 is configured to store computer programs capableof running in the second processor 1103.

The second processor 1103 is configured to run the computer programs toexecute the following operations.

A bitstream is parsed to acquire prediction parameters of a currentblock, the prediction parameters including a prediction mode parameterand a size parameter of the current block.

When the prediction mode parameter indicates that an MIP mode is adoptedto determine an intra prediction value of the current block, an MIPweight matrix of the current block, a shift factor of the current blockand an MIP input sample matrix of the current block are determined.

The intra prediction value of the current block is determined accordingto the MIP weight matrix, the shift factor and the MIP input samplematrix.

Optionally, as another embodiment, the second processor 1103 is furtherconfigured to run the computer programs to execute any method in theabovementioned embodiments.

It can be understood that the second memory 1102 has a hardware functionsimilar to that of the first memory 802 and the second processor 1103has a hardware function similar to that of the first processor 803.Elaborations are omitted herein.

The embodiments of the application provide a decoder. The decoder mayinclude a parsing unit, a second determination unit and a secondprediction unit. The parsing unit is configured to parse a bitstream toacquire prediction parameters of a current block, the predictionparameters including a prediction mode parameter and a size parameter ofthe current block. The second determination unit is configured to, whenthe prediction mode parameter indicates that an MIP mode is adopted todetermine an intra prediction value of the current block, determine anMIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block. The secondprediction unit is configured to determine the intra prediction value ofthe current block according to the MIP weight matrix, the shift factorand the MIP input sample matrix. In such a manner, a determinationmanner for the shift factor may be simplified, and moreover, when theshift factor is determined by use of a LUT, a memory occupied by storageof the LUT may be reduced at the same time of reducing the calculationcomplexity, so that a purpose of improving the encoding and decodingefficiency is achieved.

It is to be noted that, in the application, terms “include” and“contain” or any other variant thereof is intended to cover nonexclusiveinclusions, so that a process, method, object or device including aseries of elements not only includes those elements but also includesother elements which are not clearly listed or further includes elementsintrinsic to the process, the method, the object or the device. Underthe condition of no more limitations, an element defined by thestatement “including a/an . . . ” does not exclude existence of the sameother elements in a process, method, object or device including theelement.

The sequence numbers of the embodiments of the application are adoptednot to represent superiority-inferiority of the embodiments but only fordescription.

The methods disclosed in some method embodiments provided in theapplication may be freely combined without conflicts to obtain newmethod embodiments.

The characteristics disclosed in some product embodiments provided inthe application may be freely combined without conflicts to obtain newproduct embodiments.

The characteristics disclosed in some method or device embodimentsprovided in the application may be freely combined without conflicts toobtain new method embodiments or device embodiments.

The above is only the specific implementation mode of the applicationand not intended to limit the scope of protection of the application.Any variations or replacements apparent to those skilled in the artwithin the technical scope disclosed by the application shall fallwithin the scope of protection of the application. Therefore, the scopeof protection of the application shall be subject to the scope ofprotection of the claims.

INDUSTRIAL APPLICABILITY

The embodiments of the application are applicable for to an encoder or adecoder. After prediction parameters of a current block are obtained,when a prediction mode parameter in the prediction parameters indicatesthat an MIP mode is adopted to determine an intra prediction value ofthe current block, an MIP weight matrix of the current block, a shiftfactor of the current block and an MIP input sample matrix of thecurrent block may be determined, and then the intra prediction value ofthe current block is determined according to the MIP weight matrix, theshift factor and the MIP input sample matrix. In such a manner, oneither a decoder side or an encoder side, a determination manner for theshift factor may be simplified, and moreover, when the shift factor isdetermined by use of a LUT, a memory occupied by storage of a LUT may bereduced at the same time of reducing the calculation complexity, so thata purpose of improving the encoding and decoding efficiency is achieved.

1. A method for colour component prediction, applicable for an encoderand comprising: determining prediction parameters of a current block,the prediction parameters comprising a prediction mode parameter and asize parameter of the current block; when the prediction mode parameterindicates that a Matrix-based Intra Prediction (MIP) mode is adopted todetermine an intra prediction value of the current block, determining anMIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block; anddetermining the intra prediction value of the current block according tothe MIP weight matrix, the shift factor and the MIP input sample matrix,wherein the MIP weight matrix of the current block is at leastdetermined according to a block size index value of the current blockand the block size index value of the current block is determinedaccording to the size parameter of the current block.
 2. The method ofclaim 1, wherein the shift factor of the current block comprises aconstant shift factor.
 3. The method of claim 2, wherein a value of theconstant shift factor is equal to
 6. 4. The method of claim 1, whereindetermining the block size index value of the current block according tothe size parameter of the current block comprises: when both a width andheight of the current block are equal to 4, setting the block size indexvalue of the current block equal to 0; when both the width and height ofthe current block are equal to 8 or one of the width and height of thecurrent block is equal to 4, setting the block size index value of thecurrent block equal to 1; or when both the width and height of thecurrent block do not meet the above conditions, setting the block sizeindex value of the current block equal to
 2. 5. The method of claim 1,wherein determining the intra prediction value of the current blockaccording to the MIP weight matrix, the shift factor and the MIP inputsample matrix comprises: performing matrix multiplication processing onthe MIP input sample matrix, the MIP weight matrix and the shift factorby use of a preset calculation model to obtain the MIP-based predictionblock of the current block; and performing filtering processing on theMIP-based prediction block to obtain the intra prediction value of thecurrent block, the MIP-based prediction block comprising predictionvalues of at least part of pixel positions in the current block.
 6. Amethod for colour component prediction, applicable for a decoder andcomprising: parsing a bitstream to acquire prediction parameters of acurrent block, the prediction parameters comprising a prediction modeparameter and a size parameter of the current block; when the predictionmode parameter indicates that a Matrix-based Intra Prediction (MIP) modeis adopted to determine an intra prediction value of the current block,determining an MIP weight matrix of the current block, a shift factor ofthe current block and an MIP input sample matrix of the current block;and determining the intra prediction value of the current blockaccording to the MIP weight matrix, the shift factor and the MIP inputsample matrix, wherein the MIP weight matrix of the current block isdetermined at least according to a block size index value of the currentblock and the block size index value of the current block is determinedaccording to the size parameter of the current block.
 7. The method ofclaim 6, wherein the shift factor of the current block comprises aconstant shift factor.
 8. The method of claim 7, wherein a value of theconstant shift factor is equal to
 6. 9. The method of claim 6, whereindetermining the block size index value of the current block according tothe size parameter of the current block comprises: when both a width andheight of the current block are equal to 4, setting the block size indexvalue of the current block equal to 0; when both the width and height ofthe current block are equal to 8 or one of the width and height of thecurrent block is equal to 4, setting the block size index value of thecurrent block equal to; or when both the width and height of the currentblock do not meet the above conditions, setting the block size indexvalue of the current block equal to
 2. 10. The method of claim 6,wherein determining the intra prediction value of the current blockaccording to the MIP weight matrix, the shift factor and the MIP inputsample matrix comprises: performing matrix multiplication processing onthe MIP input sample matrix, the MIP weight matrix and the shift factorby use of a preset calculation model to obtain the MIP-based predictionblock of the current block; and performing filtering processing on theMIP-based prediction block to obtain the intra prediction value of thecurrent block, the MIP-based prediction block comprising predictedvalues of at least part of pixel positions in the current block.
 11. Anencoder, comprising a memory and a processor, wherein the memory isconfigured to store computer programs capable of running in theprocessor; and the processor is configured to run the computer programsto: determine prediction parameters of a current block, the predictionparameters comprising a prediction mode parameter and a size parameterof the current block; when the prediction mode parameter indicates thata Matrix-based Intra Prediction (MIP) mode is adopted to determine anintra prediction value of the current block, determine an MIP weightmatrix of the current block, a shift factor of the current block and anMIP input sample matrix of the current block; and determine the intraprediction value of the current block according to the MIP weightmatrix, the shift factor and the MIP input sample matrix, wherein theMIP weight matrix of the current block is at least determined accordingto a block size index value of the current block and the block sizeindex value of the current block is determined according to the sizeparameter of the current block.
 12. The encoder of claim 11, wherein theshift factor of the current block comprises a constant shift factor. 13.The encoder of claim 12, wherein a value of the constant shift factor isequal to
 6. 14. The encoder of claim 11, wherein the processor isfurther configured to run the computer programs to: set the block sizeindex value of the current block equal to 0 when both a width and heightof the current block are equal to 4; set the block size index value ofthe current block equal to 1 when both the width and height of thecurrent block are equal to 8 or one of the width and height of thecurrent block is equal to 4; or set the block size index value of thecurrent block equal to 2 when both the width and height of the currentblock do not meet the above conditions.
 15. The encoder of claim 14,wherein the processor is further configured to run the computer programsto: perform matrix multiplication processing on the MIP input samplematrix, the MIP weight matrix and the shift factor by use of a presetcalculation model to obtain the MIP-based prediction block of thecurrent block; and perform filtering processing on the MIP-basedprediction block to obtain the intra prediction value of the currentblock, the MIP-based prediction block comprising prediction values of atleast part of pixel positions in the current block.
 16. A decoder,comprising a memory and a processor, wherein the memory is configured tostore computer programs capable of running in the processor; and theprocessor is configured to run the computer programs to: parse abitstream to acquire prediction parameters of a current block, theprediction parameters comprising a prediction mode parameter and a sizeparameter of the current block; when the prediction mode parameterindicates that a Matrix-based Intra Prediction (MIP) mode is adopted todetermine an intra prediction value of the current block, determine anMIP weight matrix of the current block, a shift factor of the currentblock and an MIP input sample matrix of the current block; and determinethe intra prediction value of the current block according to the MIPweight matrix, the shift factor and the MIP input sample matrix, whereinthe MIP weight matrix of the current block is determined at leastaccording to a block size index value of the current block and the blocksize index value of the current block is determined according to thesize parameter of the current block.
 17. The decoder of claim 16,wherein the shift factor of the current block comprises a constant shiftfactor.
 18. The decoder of claim 17, wherein a value of the constantshift factor is equal to
 6. 19. The decoder of claim 16, wherein theprocessor is further configured to run the computer programs to: set theblock size index value of the current block equal to 0 when both a widthand height of the current block are equal to 4; set the block size indexvalue of the current block equal to 1 when both the width and height ofthe current block are equal to 8 or one of the width and height of thecurrent block is equal to 4; or set the block size index value of thecurrent block equal to 2 when both the width and height of the currentblock do not meet the above conditions.
 20. The decoder of claim 16,wherein the processor is further configured to run the computer programsto: perform matrix multiplication processing on the MIP input samplematrix, the MIP weight matrix and the shift factor by use of a presetcalculation model to obtain the MIP-based prediction block of thecurrent block; and perform filtering processing on the MIP-basedprediction block to obtain the intra prediction value of the currentblock, the MIP-based prediction block comprising predicted values of atleast part of pixel positions in the current block.